﻿using System;
using System.Web;
using YerongapillyGreens.Web.Extensions;

namespace YerongapillyGreens.Web.MasterPages
{
    public partial class Site1 : System.Web.UI.MasterPage
    {
        private const string CLASS = "class";
        private const string ACTIVE = "active";


        protected void Page_Load(object sender, EventArgs e)
        {
            string path = HttpContext.Current.Request.Url.AbsolutePath;

            linkLocation.Attributes.Remove(CLASS);
            linkApartments.Attributes.Remove(CLASS);
            linkFloorPlan.Attributes.Remove(CLASS);
            linkGallery.Attributes.Remove(CLASS);
            linkContact.Attributes.Remove(CLASS);
            linkHome.Attributes.Remove(CLASS);

            if (path.containsString("location"))
                linkLocation.Attributes[CLASS] = ACTIVE;
            else if (path.containsString("apartment"))
                linkApartments.Attributes[CLASS] = ACTIVE;
            else if (path.containsString("floor"))
                linkFloorPlan.Attributes[CLASS] = ACTIVE;
            else if (path.containsString("gallery"))
                linkGallery.Attributes[CLASS] = ACTIVE;
            else if (path.containsString("contact"))
                linkContact.Attributes[CLASS] = ACTIVE;
            else
                linkHome.Attributes[CLASS] = ACTIVE;

        }
    }
}